#!/bin/sh
yesterday=`date -d "yesterday" +%Y-%m-%d`
echo "$yesterday"
/opt/lagou/servers/hive-2.3.7/bin/hive -e "use mydb;insert into table user_info select count(distinct id),to_date(click_time) from user_clicks where to_date(click_time)='$yesterday' group by to_date(click_time);"